//
//  XuanZeCell.m
//  KCFurProject
//
//  Created by ios程序员 on 15/11/30.
//  Copyright © 2015年 ios程序员. All rights reserved.
//

#import "XuanZeCell.h"

@implementation XuanZeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        XuanZeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, -10, 60, 60)];
        [self.contentView addSubview:XuanZeImageView];
        kuCunLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 20, 50, 15)];
        [self.contentView addSubview:kuCunLabel];
        colorLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 40, 50, 15)];
        [self.contentView addSubview:colorLabel];
        numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 55, 50, 10)];
        [self.contentView addSubview:numberLabel];
    }
    return self;
}

-(void)setDate:(XuanZeModle *)dicDate
{
    cellData = dicDate;
    XuanZeImageView.image = [UIImage imageNamed:dicDate.image];
    kuCunLabel.text = dicDate.kCLabel;
    colorLabel.text = dicDate.colorLabel;
    numberLabel.text = dicDate.number;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    if(selected){
        self.backgroundColor = RGBCOLOR(12, 102, 188);
        XuanZeImageView.image = [UIImage imageNamed:cellData.image];
        InfoLabel.textColor = [UIColor whiteColor];
    }else{
        self.backgroundColor = [UIColor whiteColor];
        XuanZeImageView.image = [UIImage imageNamed:cellData.image];
        InfoLabel.textColor = [UIColor blackColor];
    }

}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
